function method()
{
	var data={};
	var arr=new Array(5);
	data["arr"]=arr;
	return data;
}

var moduleStr=[
{"name":"商家案例","moddraw":"sjalJs"},
{"name":"管家案例","moddraw":"sjalJs"},
{"name":"摄影案例","moddraw":"sjalJs"},
{"name":"婚礼案例","moddraw":"sjalJs"},
{"name":"品牌介绍","moddraw":"ppjsJs"},
{"name":"管家介绍","moddraw":"ppjsJs"},
{"name":"个人介绍","moddraw":"ppjsJs"},
{"name":"顾客评价","moddraw":"gkpjJs"},
{"name":"照片欣赏","moddraw":"zpxsJs"},
{"name":"商品详情","moddraw":"zpxsJs"},
{"name":"套系包含","moddraw":"albhJs"},
{"name":"商品信息","moddraw":"albhJs"},
{"name":"案例包含","moddraw":"albhJs"},
{"name":"餐厅介绍","moddraw":"sjalJs"},
{"name":"酒店介绍","moddraw":"ppjsJs"},
{"name":"套系包含","moddraw":"albhJs"},
{"name":"蜜月包含","moddraw":"albhJs"},
];
console.log(encodeURI(encodeURI("在线购买")));
mui(".detail-select ul li").each(function(index,item){
	
	item.addEventListener("tap",function(){
		if(this.className!="active")
		{
			this.parentNode.querySelector(".active").className="";
			this.className="active";
			
			var html = template(this.getAttribute("data-js"),method());
			
			mui("#conWrap")[0].innerHTML=html;
			
		}
		
	})
})


function init(){
	var modNum = getUrlParam("drawmod");
	//console.log(modNum);
	
	/*渲染头部*/
	var html = template(getUrlParam("headstyle"),method());
	mui("#content-header")[0].innerHTML=html;
	
	/*渲染切换,并保存要渲染的模板*/
	mui(".detail-select ul li").each(function(index,item){
		item.innerText = moduleStr[modNum.split("*")[index]].name;
		item.setAttribute("data-js",moduleStr[modNum.split("*")[index]].moddraw);
	})
	
	/*渲染底部按钮*/
	//console.log(mui(".footer-btn")[0]);
	if(getUrlParam("btntxt"))
	{
		console.log(encodeURI(encodeURI("免费预约看场地")));
		mui(".footer-btn")[0].innerText=decodeURI(decodeURI(getUrlParam("btntxt")));
	}
	
	//渲染第一个模板
	var html = template(moduleStr[modNum.split("*")[0]].moddraw,method());
	mui("#conWrap")[0].innerHTML=html;
}

/*获取第一模块*/
//var firsJs = mui(".detail-select ul li")[0].getAttribute("data-js");
init();

/*获取url参数*/
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if(r != null) {
		return unescape(r[2])
	}
	return null
}



